home *** CD-ROM | disk | FTP | other *** search
/ ftp.cs.arizona.edu / ftp.cs.arizona.edu.tar / ftp.cs.arizona.edu / icon / newsgrp / group98a.txt / 000065_icon-group-sender _Thu Feb 26 13:58:22 1998.msg < prev    next >
Internet Message Format  |  2000-09-20  |  4KB

  1. Return-Path: <icon-group-sender>
  2. Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239])
  3.     by baskerville.CS.Arizona.EDU (8.8.7/8.8.7) with SMTP id NAA08485
  4.     for <icon-group-addresses@baskerville.CS.Arizona.EDU>; Thu, 26 Feb 1998 13:58:21 -0700 (MST)
  5. Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM)
  6.     id AA00098; Thu, 26 Feb 1998 13:58:21 -0700
  7. Message-Id: <34F585F0.1AFC@gte.net>
  8. Date: Thu, 26 Feb 1998 09:10:40 -0600
  9. From: Mark Evans <evans@gte.net>
  10. Reply-To: evans@gte.net
  11. Organization: None
  12. X-Mailer: Mozilla 3.01 (Win95; I)
  13. Mime-Version: 1.0
  14. To: icon-group@optima.CS.Arizona.EDU
  15. Cc: evans@gte.net
  16. Subject: Re: Translation into C
  17. References: <199802251930.NAA16169@axp.cmpu.net>
  18. Content-Type: text/plain; charset=us-ascii
  19. Content-Transfer-Encoding: 7bit
  20. Errors-To: icon-group-errors@optima.CS.Arizona.EDU
  21. Status: RO
  22. Content-Length: 3434
  23.  
  24. gep2@computek.net wrote:
  25. > > Mark Evans suggested that the reason one might want an Icon to C
  26. > translator is that the resulting program will execute faster because it
  27. > doesn't need to be interpreted.  But I wonder how much difference that
  28. > would really make.  If the C program spends most of its time calling
  29. > library routines, then I wouldn't expect much difference at all.
  30. > Right.
  31. >
  32.  
  33. I don't follow the logic here.  Even compiled C programs spend most of
  34. their time inside libraries (system, numerical, string, file).  I
  35. certainly don't want to rewrite the StdCLib.
  36.  
  37. > > Does anyone have statistics that might answer this question?
  38. > I think that statistics for different implementations will vary all over the
  39. > place... I'd comment though that generally the overhead of an interpreter is
  40. > less (and the advantages are more) for higher-level languages than for
  41. > lower-level ones, for exactly the reason you yourself suggested above.
  42.  
  43. I have some anecdotal statistics of my own.  I have used several
  44. interpreted languages related to numerical analysis; let's take four of
  45. them, Mathematica, MATLAB, O-Matrix, and LabVIEW.  In principle, all of
  46. them are interpreted except LabVIEW, which claims to be "compiled."
  47.  
  48. I've used Mathematica more than any of them and it is closest in nature
  49. to Icon.  It is very high-level.  The usual case is that I prototype an
  50. algorithm in MMA and then port it to C.  The resulting speedup is
  51. usually larger than 10x, sometimes 20x to 50x.  The example I am
  52. thinking of is 2D image convolution.  I know how to code well in MMA so
  53. I know it's not my skill involved here.  MMA has dynamic typing and
  54. other goodies similar to Icon.  In fact the two are fairly close in many
  55. respects.  It's very easy to create data structures in either language.
  56.  
  57. MATLAB - One of my clients recently asked a local robotics research
  58. outfit (ARRI) to build a simulation of their hydraulic system.  They
  59. used MATLAB and then switched to C for speed.  They switched on their
  60. own initiative because MATLAB was too slow.  The speedup was on the
  61. order of 40x (forty minutes down to one).  This was for a time-domain
  62. simulation of a relatively simple hydraulic strut invovling pressure,
  63. temperature, and bulk modulus changes to figure out the spring and
  64. damping forces.  Several nonlinear dynamical equations involved.
  65.  
  66. O-Matrix - an unusual case (http://www.omatrix.com).  This is
  67. essentially a MATLAB clone.  What make it interesting is that the
  68. company claims a 5x speed improvement over MATLAB, not by eliminating
  69. interpretation, but BY WRITING THE LIBRARY ROUTINES EFFICIENTLY.  I
  70. inquired specifically about this some while ago and the answer came back
  71. that it was basically their hand-tuned assembly-language libraries that
  72. gave them the edge over MATLAB's plain Jane C libraries.  So yes,
  73. library implementation can make a huge difference.
  74.  
  75. LabVIEW - Very interesting indeed.  The vendor uses a kind of
  76. compilation in LabVIEW of a nature that they say is "as fast as C."   It
  77. may be so for some simple Whetstone types of benchmarks, but in general
  78. I have done algorithms both ways, and LabVIEW's speed doesn't hold a
  79. candle to C.  I would estimate the slowdown again at 10x-20x or
  80. thereabouts.  I have used LabVIEW extensively and know how to code it
  81. well.
  82.  
  83. All of the above indicate to me that no interpreted system in existence
  84. has yet come close to C even though they claim to have done so.
  85.  
  86. Mark
  87.  
  88.